From 460bf6d8b9ed46159b78229f1cb07da9a1859de2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 Feb 2023 11:40:52 +0100 Subject: [PATCH] inspector: Show if accessibles aren't realized This prevents confusion and makes it clear what is going on. --- gtk/inspector/a11y.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gtk/inspector/a11y.c b/gtk/inspector/a11y.c index 5c506e24cc..f184489204 100644 --- a/gtk/inspector/a11y.c +++ b/gtk/inspector/a11y.c @@ -236,7 +236,14 @@ update_path (GtkInspectorA11y *sl) context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object)); if (GTK_IS_AT_SPI_CONTEXT (context)) - path = gtk_at_spi_context_get_context_path (GTK_AT_SPI_CONTEXT (context)); + { + if (gtk_at_context_is_realized (context)) + path = gtk_at_spi_context_get_context_path (GTK_AT_SPI_CONTEXT (context)); + else + path = "not realized"; + } + else + path = "not on bus"; #endif gtk_label_set_label (GTK_LABEL (sl->path), path); @@ -422,7 +429,7 @@ gtk_inspector_a11y_set_object (GtkInspectorA11y *sl, stack = gtk_widget_get_parent (GTK_WIDGET (sl)); page = gtk_stack_get_page (GTK_STACK (stack), GTK_WIDGET (sl)); - if (GTK_IS_ACCESSIBLE (object)) + if (GTK_IS_ACCESSIBLE (sl->object)) { context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object)); if (context) -- 2.30.2